#include <iostream>
#include <algorithm>
#include <vector>
#include "slist.h"

using namespace std;
//typedef const int * IteratorType 

template<class IteratorType,class T>
IteratorType myfind(IteratorType begin,IteratorType end,const T& value);

int main(){
	const int Count=100;
	int a[Count];
	for(int i=0;i<Count;i++)
		a[i]=i;
	
	cout<<"enter find number:";
	int fd;
	cin>>fd;
	//int* pos=find(a,a+100,fd);
	const int* pos=myfind<const int*,int>(a,a+100,fd);
	if(pos!=NULL){
		cout<<"found number "<<*pos;
	}else{
		cout<<"not found";
	}
	
	cout<<"\n";
	
	vector<int> v(Count);
	for(int i=0;i<Count;i++)
		v[i]=i;
	/*
	cout<<"enter find number:";
	cin>>fd;
	*/
	vector<int>::const_iterator it=find(v.begin(),v.end(),fd);
//	it=find(v.begin(),v.end(),bind2nd(less<int>(),32));
	if(it!=v.end()){
		cout<<"vector found number:"<<*it;
	}else{
		cout<<"not found number:"<<fd;
	}
	cout<<"\n";
	
	slist<int> s;
	for(int i=0;i<Count;i++){
		s.push_front(i);
	}
	slist<int>::iterator sit=find(s.begin(),s.end(),50);
	s.erase(sit);
	sit=find(s.begin(),s.end(),50);

	if(sit!=s.end()){
		cout<<"slist found number:"<<*sit;
	}else{
		cout<<"slist not found number";
	}
	

	pair<int,int> p=make_pair(5,7);
}

template<class IteratorType,class T>
IteratorType myfind(IteratorType begin,IteratorType end,const T& value){
	while(begin!=end && *begin!=value)
		++begin;
	return begin;
}

